<?php
class RM_EmailNotifications_Event_Handler_eWAYpaymentsComplete extends RM_EmailNotifications_Event_Handler
{
    /**
     * Only for a IDE to help me
     *
     * @var RM_Reservation_Row
     */
    protected $_eventData;

    protected function _assignUser(Dwoo_Data $data)
    {
        //TODO: later I guess we need to add some changes here.
        return $this->_assignAdmin($data);
    }

    protected function _assignAdmin(Dwoo_Data $data)
    {
        $data->assign('reservation', $this->_eventData->toArray());
        $data->assign('user', $this->_eventData->getUser()->toArray());
        return $data;
    }

    protected function _assign(Dwoo_Data $data)
    {
        switch($this->_emailNotification->destination){
            case RM_EmailNotifications::REGULAR_USER:
                return $this->_assignUser($data);
            case RM_EmailNotifications::ADMINISTRATOR:
                return $this->_assignAdmin($data);
        }
    }
}

